package com.vogue.pay.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.vogue.pay.dao.OrdersMapper;
import com.vogue.pay.entity.Orders;
import com.vogue.pay.service.OrdersService;
import com.vogue.pay.vo.ResultVo;
import org.springframework.stereotype.Service;

@Service("ordersServiceImpl")
public class OrdersServiceImpl extends ServiceImpl<OrdersMapper, Orders> implements OrdersService {
    @Override
    public ResultVo queryOrder(Integer pageNumber, Integer limit) {

        IPage page=new Page<Orders>(pageNumber,limit);

        page(page,new QueryWrapper<Orders>().orderByDesc("id"));

        return ResultVo.success(page.getTotal(),page.getRecords());
    }
}
